import { createRouter, createWebHistory } from 'vue-router';
import Login from '../views/Login.vue'
import register from '../views/register.vue'
import changepassword from '../views/changepassword.vue'
import accountmanagement from '../views/container/accountmanagement.vue'
import main from '../views/container/main.vue'
import studentliebiao from '../views/container/studentliebiao.vue'
import home from '../views/home.vue'
import dorms from '../views/container/Dorms.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path: '/changepassword',
      name: 'changepassword',
      component: changepassword
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      children: [
        {
          path: 'main',
          name: 'main',
          component: main
        },
        {
          path: 'studentliebiao',
          name: 'studentliebiao',
          component: studentliebiao
        },
        {
          path: 'account',
          name: 'account',
          component: accountmanagement
        }
        ,
        {
          path: 'dorms',
          name: 'dorms',
          component: dorms
        }
      ]
    }
  ]
})

export default router;